package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ActivityRecordMapper;
import com.ruoyi.system.domain.ActivityRecord;
import com.ruoyi.system.service.IActivityRecordService;

/**
 * 活动记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-06-28
 */
@Service
public class ActivityRecordServiceImpl implements IActivityRecordService 
{
    @Autowired
    private ActivityRecordMapper activityRecordMapper;

    /**
     * 查询活动记录
     * 
     * @param id 活动记录主键
     * @return 活动记录
     */
    @Override
    public ActivityRecord selectActivityRecordById(Long id)
    {
        return activityRecordMapper.selectActivityRecordById(id);
    }

    /**
     * 查询活动记录列表
     * 
     * @param activityRecord 活动记录
     * @return 活动记录
     */
    @Override
    public List<ActivityRecord> selectActivityRecordList(ActivityRecord activityRecord)
    {
        return activityRecordMapper.selectActivityRecordList(activityRecord);
    }

    /**
     * 新增活动记录
     * 
     * @param activityRecord 活动记录
     * @return 结果
     */
    @Override
    public int insertActivityRecord(ActivityRecord activityRecord)
    {
        activityRecord.setCreateTime(DateUtils.getNowDate());
        return activityRecordMapper.insertActivityRecord(activityRecord);
    }

    /**
     * 修改活动记录
     * 
     * @param activityRecord 活动记录
     * @return 结果
     */
    @Override
    public int updateActivityRecord(ActivityRecord activityRecord)
    {
        activityRecord.setUpdateTime(DateUtils.getNowDate());
        return activityRecordMapper.updateActivityRecord(activityRecord);
    }

    /**
     * 批量删除活动记录
     * 
     * @param ids 需要删除的活动记录主键
     * @return 结果
     */
    @Override
    public int deleteActivityRecordByIds(Long[] ids)
    {
        return activityRecordMapper.deleteActivityRecordByIds(ids);
    }

    /**
     * 删除活动记录信息
     * 
     * @param id 活动记录主键
     * @return 结果
     */
    @Override
    public int deleteActivityRecordById(Long id)
    {
        return activityRecordMapper.deleteActivityRecordById(id);
    }
}
